#  author:张靖昆 date:2020/3/13 name:1_file IDE:PyCharm
file_path='data/first.txt'
s='hello world'
 # W:write 覆盖写 r:read 读  a:append 追加内容
with open(file_path,"w") as  fp:  #fp 是名称
#    写入内容
    fp.write(s)

content=''
with open(file_path,"r") as  fp01:  # 读取文件内容
    content=fp01.read()

print(content)
